﻿using SmartSiteManagementSystem.Models.Admin;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace SmartSiteManagementSystem.IServices
{
    public interface IAdminService
    {
        #region AdminUserInfo

        /// <summary>
        /// 
        /// </summary>
        /// <param name="adminUserId"></param>
        /// <returns></returns>
        AdminUserInfo GetAdminUserInfoByUserId(Int32 adminUserId);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        int GetAdminUserInfoCount(Hashtable param);
        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        /// <param name="orderBy"></param>
        /// <param name="first"></param>
        /// <param name="rows"></param>
        /// <returns></returns>
        IList<AdminUserInfo> GetAdminUserInfoList(Hashtable param, string orderBy, int first, int rows);

        /// <summary>
        /// 插入数据
        /// </summary>
        /// <param name="obj">对象</param>
        /// <returns>返回：该条数据的主键Id</returns>
        int InsertAdminUserInfo(AdminUserInfo obj);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool UpdateAdminUserInfo(AdminUserInfo obj);


        /// <summary>
        /// 
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        AdminUserInfo GetByUsername(string username);


        /// <summary>
        /// 获取登录管理员权限数据（按钮类型的权限）
        /// </summary>
        /// <param name="adminUserid"></param>
        /// <returns></returns>
       Hashtable GetAdminUserInfoRightList(int adminUserId);
        #endregion
        #region AdminMenuInfo

        /// <summary>
        /// 
        /// </summary>
        /// <param name="adminMenuId"></param>
        /// <returns></returns>
        AdminMenuInfo GetAdminMenuInfoById(Int32 adminMenuId);
                    /// <summary>
                    /// 
                    /// </summary>
                    /// <param name="param"></param>
                    /// <param name="orderBy"></param>
                    /// <param name="first"></param>
                    /// <param name="rows"></param>
                    /// <returns></returns>
        IList<AdminMenuInfo> GetAdminMenuInfoListByParam(Hashtable param, string orderBy, int first, int rows);
        IList<AdminMenuInfo> GetNavigationMenu(int adminUserId, int userType);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="menuList"></param>
        /// <returns></returns>
        IList<Hashtable> GetTree(IList<AdminMenuInfo> menuList);
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        IList<AdminMenuInfo> GetAllMenuInfoList();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool UpdateAdminMenuInfo(AdminMenuInfo obj);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        int InsertAdminMenuInfo(AdminMenuInfo obj);

        /// <summary>
        /// 删除菜单和关联数据
        /// </summary>
        /// <param name="adminMenuId"></param>
        /// <returns></returns>
        bool DeleteMenuAndRelData(int adminMenuId);
        #endregion

        #region AdminGroupInfo
        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        int GetAdminGroupCount(Hashtable param);


        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        /// <param name="orderBy"></param>
        /// <param name="first"></param>
        /// <param name="rows"></param>
        /// <returns></returns>
        IList<AdminGroupInfo> GetAdminGroupList(Hashtable param, string orderBy, int first, int rows);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="groupId"></param>
        /// <returns></returns>
        AdminGroupInfo GetAdminGroupById(int groupId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        int InsertAdminUserGroup(AdminGroupInfo obj);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool UpdateAdminUserGroup(AdminGroupInfo obj);

        #endregion

        #region AdminUserGroupMenuInfo
        IList<AdminUserGroupMenuInfo> GetAllAdminUserGroupMenuListByadminUserId(int adminUserGroupId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="adminUserGroupId"></param>
        /// <param name="ids"></param>
        void UpdateAdminUserGroupMenu(int adminUserGroupId, string ids);
        #endregion

        #region AdminGroupBtnRelInfo
        /// <summary>
        /// 提取数据
        /// </summary>
        /// <param name="param">可选参数为：</param>
        /// <param name="orderBy">排序方式:默认为“RelId asc”</param>
        /// <param name="first">起始记录：从0开始</param>
        /// <param name="rows">提取的条数</param>
        /// <returns></returns>
        IList<AdminGroupBtnRelInfo> GetAdminGroupBtnRelInfoList(Hashtable param, string orderBy, int first, int rows);
        #endregion

        #region AdminPageBtnInfo
        /// <summary>
        /// 
        /// </summary>
        /// <param name="btnId"></param>
        /// <param name="relList"></param>
        /// <param name="btnName"></param>
        /// <param name="btnClientId"></param>
        /// <param name="btnSortNo"></param>
        /// <param name="btnType"></param>
        /// <param name="adminMenuId"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
       bool UpdateAdminPageBtnInfo(int[] btnId, string[] relList, string[] btnName, string[] btnClientId, int[] btnSortNo, int[] btnType, int adminMenuId, string userName);
        /// <summary>
        /// /
        /// </summary>
        /// <param name="adminMenuId"></param>
        /// <returns></returns>
        IList<AdminPageBtnInfo> GetAdminPageBtnInfoList(int adminMenuId);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        /// <param name="orderBy"></param>
        /// <param name="first"></param>
        /// <param name="rows"></param>
        /// <returns></returns>
        IList<AdminPageBtnInfo> GetAdminPageBtnInfoListByParam(Hashtable param, string orderBy, int first, int rows);
        #endregion

        #region AdminUserGroupRelationInfo

        /// <summary>
        /// 用户是否属于某个角色
        /// </summary>
        /// <returns></returns>
        bool IsExistAdminUserGroupRelation(int admingroupId, int adminUsrId);

        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="adminUserId">adminUserId</param>
        /// <returns>返回</returns>
        bool DeleteAdminUserGroupRelationInfo(int adminUserId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        int InsertAdminUserGroupRelationInfo(AdminUserGroupRelationInfo info);
        #endregion

    }

}
